﻿namespace Infra.Validation
{
    using System;
    using System.Text;

    /// <summary>
    /// A Warning validation message.
    /// </summary>
    public sealed class WarningValidationMessage : ValidationMessage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WarningValidationMessage"/> class.
        /// </summary>
        /// <param name="warningMessage">The warning message.</param>
        internal WarningValidationMessage(string warningMessage) : base(warningMessage)
        {}
        
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.AppendFormat("The following warnings has been found:{0}", Environment.NewLine);
            sb.AppendFormat("{0} {1}", "".PadLeft(3), base.Message);

            return sb.ToString();
        }

        /// <summary>
        /// A warning message isn´t stopper.
        /// </summary>
        /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
        public override bool IsStopper
        {
            get { return false; }
        }
    }
}
